home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Need_For_S2060354152007.psc / NeedForSpeed New version / Form1.frm next >
Text File  |  2007-04-15  |  40KB  |  1,490 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H80000007&
  4.    Caption         =   ":: Need For Speed :: *Parazan Productions*"
  5.    ClientHeight    =   6165
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   9570
  9.    Icon            =   "Form1.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   6165
  12.    ScaleWidth      =   9570
  13.    StartUpPosition =   1  'CenterOwner
  14.    Begin VB.Timer Timer4 
  15.       Interval        =   100
  16.       Left            =   7800
  17.       Top             =   1560
  18.    End
  19.    Begin VB.PictureBox vgear 
  20.       Appearance      =   0  'Flat
  21.       AutoSize        =   -1  'True
  22.       BackColor       =   &H00000000&
  23.       ForeColor       =   &H80000008&
  24.       Height          =   540
  25.       Left            =   7680
  26.       Picture         =   "Form1.frx":030A
  27.       ScaleHeight     =   510
  28.       ScaleWidth      =   525
  29.       TabIndex        =   39
  30.       Top             =   240
  31.       Width           =   555
  32.    End
  33.    Begin VB.TextBox ai 
  34.       Alignment       =   2  'Center
  35.       Appearance      =   0  'Flat
  36.       BackColor       =   &H00004000&
  37.       ForeColor       =   &H00FFFFFF&
  38.       Height          =   285
  39.       Left            =   6600
  40.       TabIndex        =   37
  41.       Text            =   "96"
  42.       Top             =   4920
  43.       Width           =   2655
  44.    End
  45.    Begin VB.CheckBox second 
  46.       BackColor       =   &H80000007&
  47.       Caption         =   "Race With Another Car?"
  48.       ForeColor       =   &H00008000&
  49.       Height          =   255
  50.       Left            =   4080
  51.       TabIndex        =   35
  52.       Top             =   5640
  53.       Width           =   2055
  54.    End
  55.    Begin VB.PictureBox car2 
  56.       Appearance      =   0  'Flat
  57.       AutoSize        =   -1  'True
  58.       BackColor       =   &H80000005&
  59.       ForeColor       =   &H80000008&
  60.       Height          =   825
  61.       Left            =   1440
  62.       Picture         =   "Form1.frx":07FD
  63.       ScaleHeight     =   795
  64.       ScaleWidth      =   360
  65.       TabIndex        =   33
  66.       Top             =   5040
  67.       Width           =   390
  68.    End
  69.    Begin VB.PictureBox car 
  70.       Appearance      =   0  'Flat
  71.       AutoSize        =   -1  'True
  72.       BackColor       =   &H00000000&
  73.       ForeColor       =   &H80000008&
  74.       Height          =   825
  75.       Left            =   480
  76.       Picture         =   "Form1.frx":0C94
  77.       ScaleHeight     =   795
  78.       ScaleWidth      =   360
  79.       TabIndex        =   0
  80.       Top             =   5040
  81.       Width           =   390
  82.    End
  83.    Begin VB.PictureBox started 
  84.       Appearance      =   0  'Flat
  85.       AutoSize        =   -1  'True
  86.       BackColor       =   &H80000007&
  87.       ForeColor       =   &H80000008&
  88.       Height          =   60
  89.       Left            =   120
  90.       Picture         =   "Form1.frx":112B
  91.       ScaleHeight     =   30
  92.       ScaleWidth      =   2250
  93.       TabIndex        =   32
  94.       Top             =   5040
  95.       Width           =   2280
  96.    End
  97.    Begin VB.CheckBox auto 
  98.       BackColor       =   &H80000007&
  99.       Caption         =   "Automatic Gear?"
  100.       ForeColor       =   &H00008000&
  101.       Height          =   255
  102.       Left            =   2520
  103.       MaskColor       =   &H00808080&
  104.       TabIndex        =   30
  105.       Top             =   5640
  106.       Width           =   3615
  107.    End
  108.    Begin VB.PictureBox konos 
  109.       Appearance      =   0  'Flat
  110.       AutoSize        =   -1  'True
  111.       BackColor       =   &H80000006&
  112.       ForeColor       =   &H80000008&
  113.       Height          =   225
  114.       Index           =   9
  115.       Left            =   960
  116.       Picture         =   "Form1.frx":14EA
  117.       ScaleHeight     =   195
  118.       ScaleWidth      =   810
  119.       TabIndex        =   27
  120.       Top             =   6360
  121.       Width           =   840
  122.    End
  123.    Begin VB.PictureBox konos 
  124.       Appearance      =   0  'Flat
  125.       AutoSize        =   -1  'True
  126.       BackColor       =   &H80000006&
  127.       ForeColor       =   &H80000008&
  128.       Height          =   225
  129.       Index           =   8
  130.       Left            =   1680
  131.       Picture         =   "Form1.frx":18BB
  132.       ScaleHeight     =   195
  133.       ScaleWidth      =   810
  134.       TabIndex        =   26
  135.       Top             =   6480
  136.       Width           =   840
  137.    End
  138.    Begin VB.PictureBox konos 
  139.       Appearance      =   0  'Flat
  140.       AutoSize        =   -1  'True
  141.       BackColor       =   &H80000006&
  142.       ForeColor       =   &H80000008&
  143.       Height          =   225
  144.       Index           =   7
  145.       Left            =   1680
  146.       Picture         =   "Form1.frx":1C7B
  147.       ScaleHeight     =   195
  148.       ScaleWidth      =   810
  149.       TabIndex        =   25
  150.       Top             =   7080
  151.       Width           =   840
  152.    End
  153.    Begin VB.PictureBox konos 
  154.       Appearance      =   0  'Flat
  155.       AutoSize        =   -1  'True
  156.       BackColor       =   &H80000006&
  157.       ForeColor       =   &H80000008&
  158.       Height          =   225
  159.       Index           =   6
  160.       Left            =   360
  161.       Picture         =   "Form1.frx":2040
  162.       ScaleHeight     =   195
  163.       ScaleWidth      =   810
  164.       TabIndex        =   24
  165.       Top             =   7080
  166.       Width           =   840
  167.    End
  168.    Begin VB.PictureBox konos 
  169.       Appearance      =   0  'Flat
  170.       AutoSize        =   -1  'True
  171.       BackColor       =   &H80000006&
  172.       ForeColor       =   &H80000008&
  173.       Height          =   225
  174.       Index           =   5
  175.       Left            =   1200
  176.       Picture         =   "Form1.frx":2406
  177.       ScaleHeight     =   195
  178.       ScaleWidth      =   810
  179.       TabIndex        =   23
  180.       Top             =   6720
  181.       Width           =   840
  182.    End
  183.    Begin VB.PictureBox konos 
  184.       Appearance      =   0  'Flat
  185.       AutoSize        =   -1  'True
  186.       BackColor       =   &H80000006&
  187.       ForeColor       =   &H80000008&
  188.       Height          =   225
  189.       Index           =   4
  190.       Left            =   120
  191.       Picture         =   "Form1.frx":27C4
  192.       ScaleHeight     =   195
  193.       ScaleWidth      =   810
  194.       TabIndex        =   22
  195.       Top             =   6720
  196.       Width           =   840
  197.    End
  198.    Begin VB.PictureBox konos 
  199.       Appearance      =   0  'Flat
  200.       AutoSize        =   -1  'True
  201.       BackColor       =   &H80000006&
  202.       ForeColor       =   &H80000008&
  203.       Height          =   225
  204.       Index           =   3
  205.       Left            =   960
  206.       Picture         =   "Form1.frx":2B86
  207.       ScaleHeight     =   195
  208.       ScaleWidth      =   810
  209.       TabIndex        =   21
  210.       Top             =   6960
  211.       Width           =   840
  212.    End
  213.    Begin VB.PictureBox konos 
  214.       Appearance      =   0  'Flat
  215.       AutoSize        =   -1  'True
  216.       BackColor       =   &H80000006&
  217.       ForeColor       =   &H80000008&
  218.       Height          =   225
  219.       Index           =   2
  220.       Left            =   480
  221.       Picture         =   "Form1.frx":2F3F
  222.       ScaleHeight     =   195
  223.       ScaleWidth      =   810
  224.       TabIndex        =   20
  225.       Top             =   6360
  226.       Width           =   840
  227.    End
  228.    Begin VB.PictureBox konos 
  229.       Appearance      =   0  'Flat
  230.       AutoSize        =   -1  'True
  231.       BackColor       =   &H80000006&
  232.       ForeColor       =   &H80000008&
  233.       Height          =   225
  234.       Index           =   1
  235.       Left            =   2040
  236.       Picture         =   "Form1.frx":3303
  237.       ScaleHeight     =   195
  238.       ScaleWidth      =   810
  239.       TabIndex        =   19
  240.       Top             =   6720
  241.       Width           =   840
  242.    End
  243.    Begin VB.PictureBox finish 
  244.       Appearance      =   0  'Flat
  245.       AutoSize        =   -1  'True
  246.       BackColor       =   &H80000005&
  247.       ForeColor       =   &H80000008&
  248.       Height          =   90
  249.       Left            =   0
  250.       Picture         =   "Form1.frx":36C5
  251.       ScaleHeight     =   60
  252.       ScaleWidth      =   2250
  253.       TabIndex        =   18
  254.       Top             =   6240
  255.       Width           =   2280
  256.    End
  257.    Begin VB.CommandButton Command1 
  258.       BackColor       =   &H00C0C0C0&
  259.       Caption         =   "Start New Race"
  260.       BeginProperty Font 
  261.          Name            =   "MS Sans Serif"
  262.          Size            =   9.75
  263.          Charset         =   161
  264.          Weight          =   400
  265.          Underline       =   0   'False
  266.          Italic          =   0   'False
  267.          Strikethrough   =   0   'False
  268.       EndProperty
  269.       Height          =   495
  270.       Left            =   6600
  271.       MaskColor       =   &H00FFFFFF&
  272.       Style           =   1  'Graphical
  273.       TabIndex        =   15
  274.       Top             =   5520
  275.       Width           =   2775
  276.    End
  277.    Begin VB.Timer Timer3 
  278.       Left            =   7680
  279.       Top             =   3480
  280.    End
  281.    Begin VB.Timer Timer2 
  282.       Left            =   8160
  283.       Top             =   3480
  284.    End
  285.    Begin VB.Timer Timer1 
  286.       Left            =   7200
  287.       Top             =   3360
  288.    End
  289.    Begin VB.PictureBox lines 
  290.       Appearance      =   0  'Flat
  291.       AutoSize        =   -1  'True
  292.       BackColor       =   &H80000007&
  293.       ForeColor       =   &H80000008&
  294.       Height          =   6150
  295.       Index           =   1
  296.       Left            =   960
  297.       Picture         =   "Form1.frx":3A84
  298.       ScaleHeight     =   6120
  299.       ScaleWidth      =   45
  300.       TabIndex        =   3
  301.       Top             =   0
  302.       Width           =   75
  303.    End
  304.    Begin VB.PictureBox lines 
  305.       Appearance      =   0  'Flat
  306.       AutoSize        =   -1  'True
  307.       BackColor       =   &H80000007&
  308.       ForeColor       =   &H80000008&
  309.       Height          =   6150
  310.       Index           =   0
  311.       Left            =   960
  312.       Picture         =   "Form1.frx":3D83
  313.       ScaleHeight     =   6120
  314.       ScaleWidth      =   45
  315.       TabIndex        =   2
  316.       Top             =   0
  317.       Width           =   75
  318.    End
  319.    Begin VB.PictureBox road 
  320.       Appearance      =   0  'Flat
  321.       AutoSize        =   -1  'True
  322.       BackColor       =   &H80000007&
  323.       ForeColor       =   &H80000008&
  324.       Height          =   6150
  325.       Left            =   120
  326.       Picture         =   "Form1.frx":4082
  327.       ScaleHeight     =   6120
  328.       ScaleWidth      =   2130
  329.       TabIndex        =   1
  330.       Top             =   0
  331.       Width           =   2160
  332.    End
  333.    Begin VB.PictureBox back 
  334.       Appearance      =   0  'Flat
  335.       AutoSize        =   -1  'True
  336.       BackColor       =   &H80000007&
  337.       ForeColor       =   &H80000008&
  338.       Height          =   6150
  339.       Left            =   0
  340.       Picture         =   "Form1.frx":46AD
  341.       ScaleHeight     =   6120
  342.       ScaleWidth      =   2190
  343.       TabIndex        =   31
  344.       Top             =   0
  345.       Width           =   2220
  346.    End
  347.    Begin VB.Shape tgear 
  348.       BorderColor     =   &H00000000&
  349.       Height          =   855
  350.       Left            =   7320
  351.       Top             =   600
  352.       Width           =   1335
  353.    End
  354.    Begin VB.Shape l1 
  355.       BorderColor     =   &H000000C0&
  356.       Height          =   855
  357.       Left            =   7680
  358.       Top             =   480
  359.       Width           =   15
  360.    End
  361.    Begin VB.Shape m1 
  362.       BorderColor     =   &H000000C0&
  363.       Height          =   975
  364.       Left            =   7920
  365.       Top             =   480
  366.       Width           =   15
  367.    End
  368.    Begin VB.Shape r1 
  369.       BorderColor     =   &H000000C0&
  370.       Height          =   975
  371.       Left            =   8280
  372.       Top             =   480
  373.       Width           =   15
  374.    End
  375.    Begin VB.Shape mm 
  376.       BorderColor     =   &H000000C0&
  377.       Height          =   15
  378.       Left            =   7320
  379.       Top             =   840
  380.       Width           =   1215
  381.    End
  382.    Begin VB.Shape Shape4 
  383.       BorderColor     =   &H000000C0&
  384.       Height          =   1815
  385.       Left            =   6360
  386.       Top             =   120
  387.       Width           =   3135
  388.    End
  389.    Begin VB.Label Label2 
  390.       Alignment       =   2  'Center
  391.       BackColor       =   &H80000007&
  392.       Caption         =   "Artificial Intelligence ( AI ) % (Must be 90-100):"
  393.       BeginProperty Font 
  394.          Name            =   "MS Sans Serif"
  395.          Size            =   9.75
  396.          Charset         =   161
  397.          Weight          =   400
  398.          Underline       =   0   'False
  399.          Italic          =   0   'False
  400.          Strikethrough   =   0   'False
  401.       EndProperty
  402.       ForeColor       =   &H00008000&
  403.       Height          =   495
  404.       Left            =   6600
  405.       TabIndex        =   38
  406.       Top             =   4320
  407.       Width           =   2775
  408.    End
  409.    Begin VB.Label jtime 
  410.       BackColor       =   &H80000012&
  411.       BeginProperty Font 
  412.          Name            =   "MS Sans Serif"
  413.          Size            =   9.75
  414.          Charset         =   161
  415.          Weight          =   400
  416.          Underline       =   0   'False
  417.          Italic          =   0   'False
  418.          Strikethrough   =   0   'False
  419.       EndProperty
  420.       ForeColor       =   &H0000FFFF&
  421.       Height          =   255
  422.       Left            =   2520
  423.       TabIndex        =   36
  424.       Top             =   4440
  425.       Width           =   3615
  426.    End
  427.    Begin VB.Label td 
  428.       BackColor       =   &H80000012&
  429.       BeginProperty Font 
  430.          Name            =   "MS Sans Serif"
  431.          Size            =   9.75
  432.          Charset         =   161
  433.          Weight          =   400
  434.          Underline       =   0   'False
  435.          Italic          =   0   'False
  436.          Strikethrough   =   0   'False
  437.       EndProperty
  438.       Height          =   255
  439.       Left            =   2520
  440.       TabIndex        =   34
  441.       Top             =   5160
  442.       Width           =   3615
  443.    End
  444.    Begin VB.Shape Shape3 
  445.       BorderColor     =   &H000000C0&
  446.       Height          =   1815
  447.       Left            =   2400
  448.       Top             =   120
  449.       Width           =   3855
  450.    End
  451.    Begin VB.Shape Shape2 
  452.       BorderColor     =   &H80000009&
  453.       Height          =   1455
  454.       Left            =   2400
  455.       Top             =   4080
  456.       Width           =   3855
  457.    End
  458.    Begin VB.Shape Shape1 
  459.       BorderColor     =   &H80000009&
  460.       Height          =   1935
  461.       Left            =   2400
  462.       Top             =   2040
  463.       Width           =   3855
  464.    End
  465.    Begin VB.Line Line2 
  466.       BorderColor     =   &H000000C0&
  467.       BorderWidth     =   2
  468.       X1              =   5160
  469.       X2              =   4680
  470.       Y1              =   1080
  471.       Y2              =   1320
  472.    End
  473.    Begin VB.Line Line1 
  474.       BorderColor     =   &H000000C0&
  475.       BorderWidth     =   2
  476.       X1              =   3240
  477.       X2              =   2760
  478.       Y1              =   840
  479.       Y2              =   1080
  480.    End
  481.    Begin VB.Shape table1 
  482.       Height          =   1095
  483.       Left            =   2880
  484.       Shape           =   3  'Circle
  485.       Top             =   480
  486.       Width           =   1215
  487.    End
  488.    Begin VB.Shape table2 
  489.       Height          =   1215
  490.       Left            =   4560
  491.       Shape           =   3  'Circle
  492.       Top             =   480
  493.       Width           =   1215
  494.    End
  495.    Begin VB.Label best 
  496.       Height          =   495
  497.       Left            =   9480
  498.       TabIndex        =   29
  499.       Top             =   3960
  500.       Visible         =   0   'False
  501.       Width           =   1455
  502.    End
  503.    Begin VB.Label rpm2 
  504.       BackColor       =   &H80000007&
  505.       BeginProperty Font 
  506.          Name            =   "MS Sans Serif"
  507.          Size            =   9.75
  508.          Charset         =   161
  509.          Weight          =   400
  510.          Underline       =   0   'False
  511.          Italic          =   0   'False
  512.          Strikethrough   =   0   'False
  513.       EndProperty
  514.       ForeColor       =   &H00FFFFFF&
  515.       Height          =   255
  516.       Left            =   2520
  517.       TabIndex        =   28
  518.       Top             =   2880
  519.       Width           =   3615
  520.    End
  521.    Begin VB.Label Label1 
  522.       BackColor       =   &H00000000&
  523.       Caption         =   $"Form1.frx":50A3
  524.       BeginProperty Font 
  525.          Name            =   "MS Sans Serif"
  526.          Size            =   9.75
  527.          Charset         =   161
  528.          Weight          =   400
  529.          Underline       =   0   'False
  530.          Italic          =   0   'False
  531.          Strikethrough   =   0   'False
  532.       EndProperty
  533.       ForeColor       =   &H000000C0&
  534.       Height          =   1695
  535.       Left            =   6600
  536.       TabIndex        =   17
  537.       Top             =   2160
  538.       Width           =   2655
  539.    End
  540.    Begin VB.Label st 
  541.       Alignment       =   2  'Center
  542.       BackColor       =   &H80000012&
  543.       BeginProperty Font 
  544.          Name            =   "MS Sans Serif"
  545.          Size            =   9.75
  546.          Charset         =   161
  547.          Weight          =   700
  548.          Underline       =   0   'False
  549.          Italic          =   0   'False
  550.          Strikethrough   =   0   'False
  551.       EndProperty
  552.       ForeColor       =   &H000000C0&
  553.       Height          =   255
  554.       Left            =   2640
  555.       TabIndex        =   16
  556.       Top             =   1560
  557.       Width           =   3255
  558.    End
  559.    Begin VB.Label time0100 
  560.       BackColor       =   &H80000007&
  561.       BeginProperty Font 
  562.          Name            =   "MS Sans Serif"
  563.          Size            =   9.75
  564.          Charset         =   161
  565.          Weight          =   400
  566.          Underline       =   0   'False
  567.          Italic          =   0   'False
  568.          Strikethrough   =   0   'False
  569.       EndProperty
  570.       ForeColor       =   &H000000C0&
  571.       Height          =   255
  572.       Left            =   2520
  573.       TabIndex        =   14
  574.       Top             =   4200
  575.       Width           =   3615
  576.    End
  577.    Begin VB.Label timekm 
  578.       BackColor       =   &H80000007&
  579.       BeginProperty Font 
  580.          Name            =   "MS Sans Serif"
  581.          Size            =   9.75
  582.          Charset         =   161
  583.          Weight          =   400
  584.          Underline       =   0   'False
  585.          Italic          =   0   'False
  586.          Strikethrough   =   0   'False
  587.       EndProperty
  588.       ForeColor       =   &H000000C0&
  589.       Height          =   495
  590.       Left            =   2520
  591.       TabIndex        =   13
  592.       Top             =   4680
  593.       Width           =   3615
  594.    End
  595.    Begin VB.Label a 
  596.       BackColor       =   &H80000007&
  597.       BeginProperty Font 
  598.          Name            =   "MS Sans Serif"
  599.          Size            =   9.75
  600.          Charset         =   161
  601.          Weight          =   400
  602.          Underline       =   0   'False
  603.          Italic          =   0   'False
  604.          Strikethrough   =   0   'False
  605.       EndProperty
  606.       ForeColor       =   &H00FFFFFF&
  607.       Height          =   255
  608.       Left            =   2520
  609.       TabIndex        =   12
  610.       Top             =   2640
  611.       Width           =   3615
  612.    End
  613.    Begin VB.Label g 
  614.       BackColor       =   &H80000007&
  615.       BeginProperty Font 
  616.          Name            =   "MS Sans Serif"
  617.          Size            =   9.75
  618.          Charset         =   161
  619.          Weight          =   400
  620.          Underline       =   0   'False
  621.          Italic          =   0   'False
  622.          Strikethrough   =   0   'False
  623.       EndProperty
  624.       ForeColor       =   &H00FFFFFF&
  625.       Height          =   255
  626.       Left            =   2520
  627.       TabIndex        =   11
  628.       Top             =   2160
  629.       Width           =   3615
  630.    End
  631.    Begin VB.Label te 
  632.       Height          =   375
  633.       Left            =   9480
  634.       TabIndex        =   10
  635.       Top             =   4560
  636.       Visible         =   0   'False
  637.       Width           =   1455
  638.    End
  639.    Begin VB.Label real2 
  640.       Caption         =   "0"
  641.       Height          =   375
  642.       Left            =   9480
  643.       TabIndex        =   9
  644.       Top             =   5400
  645.       Visible         =   0   'False
  646.       Width           =   1455
  647.    End
  648.    Begin VB.Label real1 
  649.       Caption         =   "0"
  650.       Height          =   255
  651.       Left            =   9480
  652.       TabIndex        =   8
  653.       Top             =   5040
  654.       Visible         =   0   'False
  655.       Width           =   1455
  656.    End
  657.    Begin VB.Label x 
  658.       BackColor       =   &H80000007&
  659.       BeginProperty Font 
  660.          Name            =   "MS Sans Serif"
  661.          Size            =   9.75
  662.          Charset         =   161
  663.          Weight          =   400
  664.          Underline       =   0   'False
  665.          Italic          =   0   'False
  666.          Strikethrough   =   0   'False
  667.       EndProperty
  668.       ForeColor       =   &H00FFFFFF&
  669.       Height          =   255
  670.       Left            =   2520
  671.       TabIndex        =   7
  672.       Top             =   3120
  673.       Width           =   3615
  674.    End
  675.    Begin VB.Label tim 
  676.       BackColor       =   &H80000007&
  677.       BeginProperty Font 
  678.          Name            =   "MS Sans Serif"
  679.          Size            =   9.75
  680.          Charset         =   161
  681.          Weight          =   400
  682.          Underline       =   0   'False
  683.          Italic          =   0   'False
  684.          Strikethrough   =   0   'False
  685.       EndProperty
  686.       ForeColor       =   &H00FFFFFF&
  687.       Height          =   255
  688.       Left            =   2520
  689.       TabIndex        =   6
  690.       Top             =   3360
  691.       Width           =   3615
  692.    End
  693.    Begin VB.Label z 
  694.       BackColor       =   &H80000007&
  695.       BeginProperty Font 
  696.          Name            =   "MS Sans Serif"
  697.          Size            =   9.75
  698.          Charset         =   161
  699.          Weight          =   400
  700.          Underline       =   0   'False
  701.          Italic          =   0   'False
  702.          Strikethrough   =   0   'False
  703.       EndProperty
  704.       ForeColor       =   &H00FFFFFF&
  705.       Height          =   255
  706.       Left            =   2520
  707.       TabIndex        =   5
  708.       Top             =   3600
  709.       Width           =   3615
  710.    End
  711.    Begin VB.Label u 
  712.       BackColor       =   &H80000007&
  713.       BeginProperty Font 
  714.          Name            =   "MS Sans Serif"
  715.          Size            =   9.75
  716.          Charset         =   161
  717.          Weight          =   400
  718.          Underline       =   0   'False
  719.          Italic          =   0   'False
  720.          Strikethrough   =   0   'False
  721.       EndProperty
  722.       ForeColor       =   &H00FFFFFF&
  723.       Height          =   255
  724.       Left            =   2520
  725.       TabIndex        =   4
  726.       Top             =   2400
  727.       Width           =   3615
  728.    End
  729.    Begin VB.Image Image1 
  730.       Appearance      =   0  'Flat
  731.       Height          =   1665
  732.       Left            =   2640
  733.       Picture         =   "Form1.frx":513E
  734.       Top             =   240
  735.       Width           =   3330
  736.    End
  737. End
  738. Attribute VB_Name = "Form1"
  739. Attribute VB_GlobalNameSpace = False
  740. Attribute VB_Creatable = False
  741. Attribute VB_PredeclaredId = True
  742. Attribute VB_Exposed = False
  743. '==========================
  744. 'UPDATES
  745. '31-3-07
  746. '
  747. '1-GEARBOX DISPLAY.
  748. '2-OPpONENT'S CAR HAS HIS OWN GEARBOX.
  749. '3-car length correction.
  750. '4-two different car selection(in folder 'images)
  751. '==========================
  752.  
  753. 'Th4nx f0r u51ng!
  754.  
  755. Option Explicit
  756. Rem new
  757. Dim speed2 As Double
  758. Dim gear2 As Double
  759. Dim distance2 As Double
  760. Dim AI_difficulty As Double
  761. Rem new
  762.  
  763. 'your car gearbox
  764. Dim geara(1 To 5, 1 To 3) As Double
  765. Dim gearu(1 To 5, 1 To 3) As Double
  766. 'opponent's car gerbox
  767. Dim geara2(1 To 5, 1 To 3) As Double
  768. Dim gearu2(1 To 5, 1 To 3) As Double
  769.  
  770. Dim gear As Integer
  771. Dim sp As Integer
  772.  
  773.  
  774.  
  775.  
  776. Dim rpm As Long
  777.  
  778. Const car_meters = 4.5 'meters
  779. Dim distance As Double 'km
  780. Dim started_time As Double
  781. Dim dt As Double
  782. Dim ts2 As Double
  783. Dim dt2 As Double
  784. Dim ts As Double
  785. Dim j As Integer
  786. Dim steering As Double
  787. 'Const steering_max = 12
  788. Dim speed As Double 'km/h
  789.  
  790. Dim speed_lose As Double 'when steering:m/s^2
  791. Dim car_accelaration As Double 'm/s^2
  792. Dim car_decelaration As Double 'm/s^2
  793. Dim steering_accelaration As Double 'm/s^2
  794. Dim steering_deceleration As Double  'm/s^2
  795.  
  796.  
  797.  
  798. Private Sub ai_Change()
  799.  
  800.  
  801.  
  802. AI_difficulty = Int(ai) / 100
  803.  
  804. End Sub
  805.  
  806. Private Sub Command1_Click()
  807. Dim t11 As Double
  808. build_interface
  809. Timer1.Interval = 0
  810. Timer2.Interval = 0
  811. Timer3.Interval = 0
  812.  
  813. t11 = Timer
  814. Do
  815. DoEvents
  816. 'wait 3 seconds
  817. st = 3 - Int(Timer - t11)
  818. Loop Until Timer - t11 >= 3
  819. st = "GooOOO!!"
  820.  
  821. build_interface
  822. start
  823. End Sub
  824.  
  825. Private Sub Form_Load()
  826.  
  827. Form1.Show
  828. Form2.Show
  829.  
  830. Randomize Timer
  831. build_interface
  832.  
  833.  
  834.  
  835.  
  836.  
  837. End Sub
  838. Sub build_interface()
  839.  
  840. build_gear 'read the your gearbox's information
  841. build_gear2 'opponents
  842.  
  843. 'set the road correctly
  844. back.Left = 100
  845. road.Left = back.Left + back.Width / 2 - road.Width / 2
  846. road.Top = 0
  847.  
  848. 'set the road lines correctly
  849. lines(0).Top = road.Top
  850. lines(0).Left = road.Left + road.Width / 2 - lines(0).Width / 2
  851. lines(1).Top = road.Top - lines(0).Height
  852. lines(1).Left = road.Left + road.Width / 2 - lines(1).Width / 2
  853.  
  854. 'set the speedometer and rpm-meter correctly
  855. Line1.X1 = table1.Left + table1.Width / 2
  856. Line1.Y1 = table1.Top + table1.Height / 2
  857. Line2.X1 = table2.Left + table2.Width / 2
  858. Line2.Y1 = table2.Top + table2.Height / 2
  859.  
  860. 'set the car correctly
  861. car.Left = road.Left + road.Width / 2 - car.Width / 2
  862. car.Top = road.Top + road.Height - 1.5 * car.Height
  863.  
  864. car2.Left = -2 * car.Width
  865. car2.Top = road.Top + road.Height - 1.5 * car.Height
  866.  
  867. 'if you play with another player,show his car!
  868. If second.Value = vbChecked Then
  869.  
  870. car.Left = road.Left + road.Width / 4 - car.Width / 2
  871. car.Top = road.Top + road.Height - 1.5 * car.Height
  872.  
  873. car2.Left = road.Left + road.Width / 2 + road.Width / 4 - car.Width / 2
  874. car2.Top = car.Top
  875.  
  876. End If
  877.  
  878.  
  879. 'set the finish line
  880. finish.Top = road.Top - finish.Height
  881.  
  882. 'set the start-line
  883. started.Top = car.Top - started.Height
  884. started.Left = road.Left
  885. started.Width = road.Width
  886.  
  887. 'erase previous records
  888. timekm = "" 'previous race time.
  889. time0100 = "" 'time in which car reaches 100km/h
  890. td = ""
  891. jtime = ""
  892.  
  893. 'fix speedometer and rpm-meter value
  894. set_speedometer 0, 1 'fix speedometer value
  895. set_rpm_meter 0 'fix rpm-meter value
  896.  
  897. 'build gearbox display
  898. m1.Top = tgear.Top
  899. l1.Top = tgear.Top
  900. r1.Top = tgear.Top
  901.  
  902. l1.Left = tgear.Left + tgear.Width / 4
  903. m1.Left = tgear.Left + tgear.Width / 2
  904. r1.Left = tgear.Left + tgear.Width * 3 / 4
  905.  
  906. l1.Height = tgear.Height
  907. m1.Height = tgear.Height
  908. r1.Height = tgear.Height / 2
  909.  
  910. mm.Left = l1.Left
  911. mm.Top = tgear.Top + tgear.Height / 2
  912. mm.Width = tgear.Width / 2
  913.  
  914. vgear.Top = tgear.Top
  915. vgear.Left = tgear.Left
  916. End Sub
  917.  
  918. Sub start()
  919. Dim s As Integer
  920. Randomize Timer
  921. For s = 1 To 9
  922. 'konos(s).Left = road.Left + Rnd() * (road.Width - konos(s).Width)
  923. konos(s).Left = road.Left
  924. konos(s).Top = road.Top - konos(s).Height
  925. Next
  926.  
  927. sp = 0
  928.  
  929.  
  930.  
  931.  
  932. distance = 0 'distance that the car travelled
  933. speed = 0 'initial speed of the car
  934. steering = 0 'steering acceleration of the car
  935. gear = 1 'set the first gear of the car
  936.  
  937. set_speedometer 0, 1 'fix speedometer value
  938. car_accelaration = 0 'm/s^2.initial car acceleration.this doesn't really effect!
  939.  
  940. 'car constants=============================
  941. speed_lose = 0.5 'm/s^2.When braking,this will be the decelleration of the car
  942. car_decelaration = 11 'm/s^2 car's decceleration when braking
  943. steering_accelaration = 15 'm/s^2.car's steering acceleretion(how speedy our car is streering)
  944. steering_deceleration = 17 'm/s^2.how fast the car recovers after steering.
  945. 'car constants ended========================
  946.  
  947. 'setup the second car
  948. speed2 = 0
  949. gear2 = 1
  950. distance2 = 0
  951.  
  952. 'setup AI_difficalty
  953. AI_difficulty = Int(ai) / 100
  954.  
  955. 'initialize the timers
  956. started_time = GetTickCount
  957. ts = GetTickCount
  958. ts2 = GetTickCount
  959.  
  960. 'start the timers
  961. Timer1.Interval = 10
  962. Timer2.Interval = 10
  963. Timer3.Interval = 200
  964.  
  965.  
  966. End Sub
  967. Sub build_gear()
  968.  
  969. 'this is your gearbox info!!!
  970.  
  971. 'the accelarations for eatch gearbox
  972. 'when the speed=0!!
  973. geara(1, 1) = 3
  974. geara(2, 1) = 0.5 * geara(1, 1)
  975. geara(3, 1) = 0.33 * geara(1, 1)
  976. geara(4, 1) = 0.17 * geara(1, 1)
  977. geara(5, 1) = 0.1 * geara(1, 1)
  978.  
  979. 'these values mast be bigger than these above!
  980. 'these are the max accelarartions in the speed below(part2)
  981. 'geara(1, 2) = 4.3
  982. 'geara(2, 2) = 3.4
  983. 'geara(3, 2) = 2.4
  984. 'geara(4, 2) = 1.7
  985. 'geara(5, 2) = 1.1
  986.  
  987. geara(1, 2) = 6
  988. geara(2, 2) = 0.6 * geara(1, 2)
  989. geara(3, 2) = 0.4 * geara(1, 2)
  990. geara(4, 2) = 0.3 * geara(1, 2)
  991. geara(5, 2) = 0.22 * geara(1, 2)
  992.  
  993. geara(1, 3) = 0
  994. geara(2, 3) = 0
  995. geara(3, 3) = 0
  996. geara(4, 3) = 0
  997. geara(5, 3) = 0
  998.  
  999. Rem===================(part2)
  1000.  
  1001. gearu(1, 1) = 0
  1002. gearu(2, 1) = 0
  1003. gearu(3, 1) = 0
  1004. gearu(4, 1) = 0
  1005. gearu(5, 1) = 0
  1006.  
  1007. 'here are the velocity of each gear where you have the
  1008. 'biggest accelaration!So in this speed you must
  1009. 'shift up the gear!
  1010. gearu(1, 2) = 50
  1011. gearu(2, 2) = 80
  1012. gearu(3, 2) = 110
  1013. gearu(4, 2) = 140
  1014. gearu(5, 2) = 170
  1015. 'these values mast be bigger than these above!
  1016. 'these are the biggest velocities for eatch gear!!
  1017. gearu(1, 3) = 70
  1018. gearu(2, 3) = 110
  1019. gearu(3, 3) = 155
  1020. gearu(4, 3) = 185
  1021. gearu(5, 3) = 220
  1022.  
  1023. End Sub
  1024. Sub build_gear2()
  1025.  
  1026. 'this is opponent's car gearbox info!!!
  1027.  
  1028. 'the accelarations for eatch gearbox
  1029. 'when the speed=0!!
  1030. geara2(1, 1) = 3.3
  1031. geara2(2, 1) = 0.5 * geara2(1, 1)
  1032. geara2(3, 1) = 0.33 * geara2(1, 1)
  1033. geara2(4, 1) = 0.17 * geara2(1, 1)
  1034. geara2(5, 1) = 0.1 * geara2(1, 1)
  1035.  
  1036. 'these values mast be bigger than these above!
  1037. 'these are the max accelarartions in the speed below(part2)
  1038. 'geara(1, 2) = 4.3
  1039. 'geara(2, 2) = 3.4
  1040. 'geara(3, 2) = 2.4
  1041. 'geara(4, 2) = 1.7
  1042. 'geara(5, 2) = 1.1
  1043.  
  1044. geara2(1, 2) = 6
  1045. geara2(2, 2) = 0.6 * geara2(1, 2)
  1046. geara2(3, 2) = 0.4 * geara2(1, 2)
  1047. geara2(4, 2) = 0.3 * geara2(1, 2)
  1048. geara2(5, 2) = 0.22 * geara2(1, 2)
  1049.  
  1050. geara2(1, 3) = 0
  1051. geara2(2, 3) = 0
  1052. geara2(3, 3) = 0
  1053. geara2(4, 3) = 0
  1054. geara2(5, 3) = 0
  1055.  
  1056. Rem===================(part2)
  1057.  
  1058. gearu2(1, 1) = 0
  1059. gearu2(2, 1) = 0
  1060. gearu2(3, 1) = 0
  1061. gearu2(4, 1) = 0
  1062. gearu2(5, 1) = 0
  1063.  
  1064. 'here are the velocity of each gear where you have the
  1065. 'biggest accelaration!So in this speed you must
  1066. 'shift up the gear!
  1067. gearu2(1, 2) = 50
  1068. gearu2(2, 2) = 90
  1069. gearu2(3, 2) = 110
  1070. gearu2(4, 2) = 140
  1071. gearu2(5, 2) = 170
  1072. 'these values mast be bigger than these above!
  1073. 'these are the biggest velocities for eatch gear!!
  1074. gearu2(1, 3) = 70
  1075. gearu2(2, 3) = 110
  1076. gearu2(3, 3) = 155
  1077. gearu2(4, 3) = 185
  1078. gearu2(5, 3) = 220
  1079.  
  1080. End Sub
  1081.  
  1082. Function lamda_down(ByVal k As Integer) As Double
  1083. lamda_down = -geara(k, 2) / (gearu(k, 3) - gearu(k, 2))
  1084. End Function
  1085. Function lamda_up(ByVal k As Integer) As Double
  1086. lamda_up = (geara(k, 2) - geara(k, 1)) / gearu(k, 2)
  1087. End Function
  1088. Function best_gear(ByVal g As Integer) As Double
  1089. 'returns the speed in which we have to
  1090. 'shift up the gearbox,in order to have
  1091. 'the best acceleration.
  1092.  
  1093. If g < 5 And g >= 1 Then
  1094. best_gear = (geara(g + 1, 1) - geara(g, 2) + lamda_down(g) * gearu(g, 2)) / (lamda_down(g) - lamda_up(g + 1))
  1095. End If
  1096.  
  1097. If g = 5 Then
  1098. 'this will never been reached
  1099. best_gear = 1.2 * gearu(5, 3)
  1100. End If
  1101.  
  1102. If g = 0 Then
  1103. best_gear = 0
  1104. End If
  1105.  
  1106. End Function
  1107. Function lamda_down2(ByVal k As Integer) As Double
  1108. lamda_down2 = -geara2(k, 2) / (gearu2(k, 3) - gearu2(k, 2))
  1109. End Function
  1110. Function lamda_up2(ByVal k As Integer) As Double
  1111. lamda_up2 = (geara2(k, 2) - geara2(k, 1)) / gearu2(k, 2)
  1112. End Function
  1113. Function best_gear2(ByVal g As Integer) As Double
  1114. 'returns the speed in which we have to
  1115. 'shift up the gearbox,in order to have
  1116. 'the best acceleration.
  1117.  
  1118. If g < 5 And g >= 1 Then
  1119. best_gear2 = (geara2(g + 1, 1) - geara2(g, 2) + lamda_down2(g) * gearu2(g, 2)) / (lamda_down2(g) - lamda_up2(g + 1))
  1120. End If
  1121.  
  1122. If g = 5 Then
  1123. 'this will never been reached
  1124. best_gear2 = 1.2 * gearu2(5, 3)
  1125. End If
  1126.  
  1127. If g = 0 Then
  1128. best_gear2 = 0
  1129. End If
  1130.  
  1131. End Function
  1132.  
  1133.  
  1134.  
  1135.  
  1136. Private Sub Form_Unload(Cancel As Integer)
  1137. Form2.Show
  1138. End Sub
  1139.  
  1140. Sub automatic_gear()
  1141. 'this will change the gearbox with the best way!
  1142.  
  1143. If speed >= best_gear(gear) And gear < 5 Then
  1144. gear = gear + 1
  1145. End If
  1146.  
  1147. If gear > 1 And speed < best_gear(gear - 1) Then
  1148. gear = gear - 1
  1149. End If
  1150.  
  1151. End Sub
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157. Private Sub Timer1_Timer()
  1158.  
  1159. dt = GetTickCount - ts
  1160. ts = GetTickCount
  1161. dt = dt / 1000
  1162.  
  1163.  
  1164. best = Round(best_gear(gear), 2)
  1165. best = "Best Speed To Shift Up The Gear: " + best + " Km/h"
  1166.  
  1167. If auto.Value = vbChecked Then
  1168. 'Let the computer change the gear.
  1169. automatic_gear
  1170. End If
  1171.  
  1172.  
  1173. 'u = Round(((car_meters * speed / car.Height) * 3600 / 1000), 2)
  1174. 'u = u + " Km/h"
  1175. u = Round(speed, 2)
  1176. u = "Speed:" + u + " Km/h"
  1177.  
  1178. 'this steering the car to the desired direction
  1179. car.Left = car.Left + (steering * car.Height * 1000 / (3600 * car_meters)) * dt
  1180.  
  1181. If car.Left < road.Left Then
  1182. car.Left = road.Left
  1183. speed = speed - 20 * dt
  1184. End If
  1185.  
  1186. If car.Left + car.Width > road.Left + road.Width Then
  1187. car.Left = road.Left + road.Width - car.Width
  1188. speed = speed - 20 * dt
  1189. End If
  1190.  
  1191. If speed < 0 Then
  1192. speed = 0
  1193. End If
  1194.  
  1195. 'check if you have gearbox overrun!!
  1196. check_gear dt
  1197.  
  1198.  
  1199.  
  1200. For j = 0 To 1
  1201. 'this is moving the road lines
  1202. lines(j).Top = lines(j).Top + (speed * car.Height * 1000 / (3600 * car_meters)) * dt
  1203.  
  1204. If lines(j).Top > road.Height + road.Top Then
  1205. lines(j).Top = road.Top - lines(j).Height
  1206. End If
  1207.  
  1208. If lines(j).Top > lines(Abs(j - 1)).Top Then
  1209. lines(Abs(j - 1)).Top = lines(j).Top - lines(j).Height - 50
  1210. End If
  1211.  
  1212. Next
  1213.  
  1214. If second.Value = vbChecked Then
  1215. 'if you play with another player
  1216. 'then move him!
  1217. car2.Left = road.Left + road.Width / 2 + road.Width / 4 - car.Width / 2
  1218. move_second_car dt
  1219. End If
  1220.  
  1221.  
  1222.  
  1223.  
  1224. If started.Top <= road.Top + road.Height Then
  1225. 'move the start-line..
  1226. started.Top = started.Top + (speed * car.Height * 1000 / (3600 * car_meters)) * dt
  1227. End If
  1228.  
  1229. If (1 - distance) * car.Height * 1000 / car_meters <= car.Top - road.Top Then
  1230. 'move the finish-line..
  1231. finish.Top = finish.Top + (speed * car.Height * 1000 / (3600 * car_meters)) * dt
  1232. End If
  1233.  
  1234. 'update car's distance so far..
  1235. distance = distance + speed * dt / 3600
  1236. x = Round(distance, 3)
  1237. x = "Distance: " + x + "Km"
  1238.  
  1239. 'update racing time so far
  1240. tim = Round((GetTickCount - started_time) / 1000, 3)
  1241. tim = "Time: " + tim + " secs"
  1242.  
  1243. If distance >= 1 Then
  1244. 'race completed::1km was runned!!!
  1245. timekm = Round((GetTickCount - started_time) / 1000, 3)
  1246. timekm = "Race Completed!Time:" + timekm + " secs"
  1247. Timer1.Interval = 0
  1248. Timer2.Interval = 0
  1249. Timer3.Interval = 0
  1250. End If
  1251.  
  1252. If speed >= 100 And sp = 0 Then
  1253. 'reached 100km/h!!!
  1254. sp = 1
  1255. time0100 = Round((GetTickCount - started_time) / 1000, 3)
  1256. time0100 = "0-100 km/h in : " + time0100 + " secs"
  1257. End If
  1258.  
  1259.  
  1260. For j = 1 To 9
  1261. 'MOVE OBJECTS.e.t 100m label,200m label.....
  1262. If ((10 - j) * 0.1 - distance) * car.Height * 1000 / car_meters <= car.Top - road.Top Then
  1263. konos(j).Top = konos(j).Top + (speed * car.Height * 1000 / (3600 * car_meters)) * dt
  1264. End If
  1265.  
  1266. If konos(j).Top <= car.Top And konos(j).Top + konos(j).Height >= car.Top Then
  1267. 'SAVE STAGE'S TIME
  1268. jtime = "Last Stage's Time: " + tim
  1269. End If
  1270.  
  1271. Next
  1272.  
  1273.  
  1274. End Sub
  1275. Sub set_speedometer(ByVal speed As Double, ByVal gear As Integer)
  1276.  
  1277. Const min_angle = 3.14 / 1.25
  1278. Const max_angle = 250
  1279.  
  1280. Rem table1
  1281. Line1.X2 = Cos(min_angle + 2 * 3.14 * speed * max_angle / (gearu(gear, 3) * 360)) * table1.Width / 2 + table1.Left + table1.Width / 2
  1282. Line1.Y2 = Sin(min_angle + 2 * 3.14 * speed * max_angle / (gearu(gear, 3) * 360)) * table1.Height / 2 + table1.Top + table1.Height / 2
  1283. End Sub
  1284.  
  1285. Sub set_rpm_meter(ByVal speed As Double)
  1286.  
  1287. Const min_angle = 3.14 / 1.25
  1288. Const max_angle = 250
  1289.  
  1290. Rem table2
  1291. Line2.X2 = Cos(min_angle + 2 * 3.14 * speed * max_angle / (gearu(5, 3) * 360)) * table2.Width / 2 + table2.Left + table2.Width / 2
  1292. Line2.Y2 = Sin(min_angle + 2 * 3.14 * speed * max_angle / (gearu(5, 3) * 360)) * table2.Height / 2 + table2.Top + table2.Height / 2
  1293. End Sub
  1294.  
  1295. Sub check_gear(ByVal dt As Double)
  1296. Dim k As Integer
  1297. Dim temp As Integer
  1298. Dim lamda As Double
  1299. Dim angle As Double
  1300.  
  1301. temp = 0
  1302. For k = 1 To 3
  1303. If speed >= gearu(gear, k) Then
  1304. temp = k
  1305. End If
  1306. Next
  1307.  
  1308. 'te = temp
  1309. g = gear
  1310. g = "Gear:" + g
  1311. If temp = 3 Then
  1312. car_accelaration = -3 'm/s
  1313. speed = speed + dt * car_accelaration * 3600 / 1000
  1314. Else
  1315. lamda = (gearu(gear, temp + 1) - gearu(gear, temp)) / (geara(gear, temp + 1) - geara(gear, temp))
  1316. car_accelaration = (speed - gearu(gear, temp)) / lamda + geara(gear, temp)
  1317. End If
  1318.  
  1319. 'FIX SPEEDOMETER'S VALUE
  1320. set_speedometer speed, gear
  1321.  
  1322.  
  1323. 'FIX RPM-METER VALUE
  1324. set_rpm_meter speed
  1325.  
  1326. rpm = speed * 8000 / gearu(gear, 3)
  1327.  
  1328. rpm2 = rpm
  1329. rpm2 = "Revolutions Per Minute: " + rpm2 + " Rpm"
  1330. a = Round(car_accelaration, 2)
  1331. a = "Car Accelaration:" + a + " m/s^2"
  1332. End Sub
  1333. Private Sub Timer2_Timer()
  1334.  
  1335.  
  1336. dt2 = GetTickCount - ts2
  1337. ts2 = GetTickCount
  1338. dt2 = dt2 / 1000
  1339.  
  1340. If GetAsyncKeyState(vbKeyLeft) Then
  1341. steering = steering - steering_accelaration * dt2 * 3600 / 1000
  1342. speed = speed - speed_lose * dt2 * 3600 / 1000
  1343. Else
  1344. If steering < 0 Then
  1345. steering = steering + steering_deceleration * dt2
  1346. End If
  1347. End If
  1348.  
  1349. If GetAsyncKeyState(vbKeyRight) Then
  1350. steering = steering + steering_accelaration * dt2 * 3600 / 1000
  1351. speed = speed - speed_lose * dt2 * 3600 / 1000
  1352. Else
  1353. If steering > 0 Then
  1354. steering = steering - steering_deceleration * dt2
  1355. End If
  1356. End If
  1357.  
  1358. If GetAsyncKeyState(vbKeyUp) Then
  1359. speed = speed + car_accelaration * dt2 * 3600 / 1000
  1360. Else
  1361. car_accelaration = -0.4
  1362. speed = speed + car_accelaration * dt2 * 3600 / 1000
  1363. End If
  1364.  
  1365. If GetAsyncKeyState(vbKeyDown) Then
  1366. speed = speed - car_decelaration * dt2 * 3600 / 1000
  1367. End If
  1368.  
  1369.  
  1370.  
  1371. If steering > steering_accelaration Then
  1372. steering = steering_accelaration
  1373. End If
  1374.  
  1375. If steering < -steering_accelaration Then
  1376. steering = -steering_accelaration
  1377. End If
  1378.  
  1379.  
  1380.  
  1381.  
  1382. z = Round(steering, 2)
  1383. z = "Streering Accelararion: " + z + " m/s^2"
  1384.  
  1385. 'ts2 = GetTickCount
  1386. End Sub
  1387.  
  1388. Private Sub Timer3_Timer()
  1389. 'this changes the gear!
  1390.  
  1391. If GetAsyncKeyState(vbKeyA) And gear < 5 Then
  1392. gear = gear + 1
  1393. End If
  1394.  
  1395. If GetAsyncKeyState(vbKeyZ) And gear > 1 Then
  1396. gear = gear - 1
  1397. End If
  1398.  
  1399. End Sub
  1400.  
  1401. Private Sub move_second_car(ByVal dt As Double)
  1402. Dim k As Integer
  1403. Dim temp As Integer
  1404. Dim lamda As Double
  1405. Dim accelaration As Double
  1406.  
  1407.  
  1408.  
  1409. 'auto-gear-system for the second car..
  1410.  
  1411. If speed2 >= best_gear2(gear2) And gear2 < 5 Then
  1412. gear2 = gear2 + 1
  1413. End If
  1414.  
  1415. If gear2 > 1 And speed2 < best_gear2(gear2 - 1) Then
  1416. gear2 = gear2 - 1
  1417. End If
  1418.  
  1419. temp = 0
  1420. For k = 1 To 3
  1421. If speed2 >= gearu2(gear2, k) Then
  1422. temp = k
  1423. End If
  1424. Next
  1425.  
  1426. lamda = (gearu2(gear2, temp + 1) - gearu2(gear2, temp)) / (geara2(gear2, temp + 1) - geara2(gear2, temp))
  1427. accelaration = (speed2 - gearu2(gear2, temp)) / lamda + geara2(gear2, temp)
  1428.  
  1429. speed2 = speed2 + accelaration * AI_difficulty * dt * 3600 / 1000
  1430. distance2 = distance2 + speed2 * dt / 3600
  1431.  
  1432. 'show the car!
  1433. car2.Top = car.Top - (Round(distance2 - distance, 5)) * 1000 * car.Height / car_meters
  1434.  
  1435. 'avoid collision with the car1
  1436. If car.Left + car.Width + 50 > road.Left + road.Width / 2 Then
  1437. car.Left = road.Left + road.Width / 2 - car.Width - 50
  1438. End If
  1439.  
  1440.  
  1441.  
  1442. 'time difference between the two cars,in seconds
  1443. td = Round(Round(distance2 - distance, 5) * 3600 / (speed + 0.00001), 3)
  1444.  
  1445. If second.Value = vbChecked Then
  1446. 'if there is another player,show time difference
  1447. If td > 0 Then
  1448. td.ForeColor = vbRed
  1449. td = "You Are Second : + " + td + " secs"
  1450. Else
  1451. td.ForeColor = vbBlue
  1452. td = "You Are First : -" + td + " secs"
  1453. End If
  1454.  
  1455. End If
  1456.  
  1457. End Sub
  1458.  
  1459. Private Sub Timer4_Timer()
  1460.  
  1461.  
  1462. If gear = 1 Then
  1463. vgear.Top = tgear.Top
  1464. vgear.Left = tgear.Left
  1465. End If
  1466.  
  1467. If gear = 2 Then
  1468. vgear.Top = tgear.Top + tgear.Height - vgear.Height
  1469. vgear.Left = tgear.Left
  1470. End If
  1471.  
  1472. If gear = 3 Then
  1473. vgear.Top = tgear.Top
  1474. vgear.Left = tgear.Left + tgear.Width / 2 - vgear.Width / 2
  1475. End If
  1476.  
  1477. If gear = 4 Then
  1478. vgear.Top = tgear.Top + tgear.Height - vgear.Height
  1479. vgear.Left = tgear.Left + tgear.Width / 2 - vgear.Width / 2
  1480. End If
  1481.  
  1482. If gear = 5 Then
  1483. vgear.Top = tgear.Top
  1484. vgear.Left = tgear.Left + tgear.Width - vgear.Width
  1485. End If
  1486.  
  1487. End Sub
  1488.  
  1489.  
  1490.